//服务层
app.service('tbUserService', function ($http) {

    //读取列表数据绑定到表单中
    this.findAll = function () {
        return $http.get(baseURL + 'manage/user/findAll');
    };
    //分页
    this.findPage = function (page, rows) {
        return $http.get(baseURL + 'manage/user/findPage?page=' + page + '&limit=' + rows);
    };
    //搜索
    this.search = function (page, rows, searchEntity) {
        return $http.post(baseURL + 'manage/user/search?page=' + page + "&limit=" + rows, searchEntity);
    };
    //查询实体
    this.findOne = function (id) {
        return $http.get(baseURL + 'manage/user/findOne?id=' + id);
    };
    //增加
    this.add = function (entity) {
        return $http.post(baseURL + 'manage/user/add', entity);
    };
    //修改
    this.update = function (entity) {
        return $http.post(baseURL + 'manage/user/update', entity);
    };
    //删除
    this.dele = function (ids) {
        return $http.get(baseURL + 'manage/user/delete?ids=' + ids);
    };
    //下拉列表数据
    this.selectOptionList = function () {
        return $http.get(baseURL + 'manage/user/selectOptionList');
    }
    //更改状态
    this.updateStatus = function (id, status) {
        return $http.get(baseURL + 'manage/user/updateStatus?id=' + id + '&status=' + status);
    }
});
